home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / utilities / misc / request_v12.lha / Request.s < prev    next >
Encoding:
Text File  |  1995-01-09  |  1.4 KB  |  100 lines

  1. ;
  2. ; This piece of code is Copyright © 1992-1995 by Stefano Reksten
  3. ; (GUNDAM) of 3AM - The Three Amigos!!
  4. ;
  5.  
  6.     incdir include:
  7.     include LVO3.0/exec_lib.i
  8.     include LVO3.0/intuition_lib.i
  9.     include LVO3.0/dos_lib.i
  10.     include intuition/intuition.i
  11.  
  12.     move.l    $4,a6
  13.     lea    DosName,a1
  14.     move.l    #36,d0
  15.     jsr    _LVOOpenLibrary(a6)
  16.     tst.l    d0
  17.     beq.w    nodos
  18.     move.l    d0,DOSBase
  19.  
  20.     lea    IntuiName,a1
  21.     move.l    #36,d0
  22.     jsr    _LVOOpenLibrary(a6)
  23.     tst.l    d0
  24.     beq.w    nointui
  25.     move.l    d0,IntuiBase
  26.  
  27.     move.l    DOSBase,a6
  28.     move.l    #ArgTemplate,d1
  29.     move.l    #ReqArgs,d2
  30.     moveq    #0,d3
  31.     jsr    _LVOReadArgs(a6)
  32.     tst.l    d0
  33.     beq.b    noargs
  34.     move.l    d0,Args
  35.  
  36.     move.l    Body,a0
  37. nxtchar
  38.     tst.b    (a0)
  39.     beq.b    nosubst
  40.     cmp.b    #'|',(a0)
  41.     bne.b    nochange
  42.     move.b    #10,(a0)
  43. nochange
  44.     adda    #1,a0
  45.     bra.b    nxtchar
  46.     
  47. nosubst
  48.     move.l    IntuiBase,a6
  49.     sub.l    a0,a0
  50.     lea    ReqStruct,a1
  51.     sub.l    a2,a2
  52.     sub.l    a3,a3
  53.     jsr    _LVOEasyRequestArgs(a6)
  54.     mulu.l    #5,d0
  55.     move.l    d0,Result
  56.  
  57.     move.l    DOSBase,a6
  58.     move.l    Args,d1
  59.     jsr    _LVOFreeArgs(a6)
  60. noargs
  61.     move.l    IntuiBase,a1
  62.     move.l    $4,a6
  63.     jsr    _LVOCloseLibrary(a6)
  64. nointui
  65.     move.l    DOSBase,a1
  66.     move.l    $4,a6
  67.     jsr    _LVOCloseLibrary(a6)
  68. nodos
  69.     move.l    Result,d0
  70.     rts
  71.     
  72. Result
  73.     dc.l    0
  74. DOSBase
  75.     dc.l    0
  76. IntuiBase
  77.     dc.l    0
  78. ReqStruct
  79.     dc.l    EasyStruct_SIZEOF
  80.     dc.l    0
  81. ReqArgs
  82. Title
  83.     dc.l    0
  84. Body
  85.     dc.l    0
  86. GadgetString
  87.     dc.l    DefaultGadgets
  88. Args
  89.     dc.l    0
  90. DosName
  91.     dc.b    "dos.library",0
  92. IntuiName
  93.     dc.b    "intuition.library",0
  94. ArgTemplate
  95.     dc.b    "Title/A,Body/A,Gadgets",0
  96. ReqString
  97.     dc.b    "$VER: Request v1.1 (01-01-95)",0
  98. DefaultGadgets
  99.     dc.b    "OK|Cancel",0
  100.